<form class="page-list-form">
<table id="dataTable"></table>
{include file="admin@block/layui" /}
<script type="text/html" title="操作按钮模板" id="buttonTpl">
    <a href="{:url('code')}?areaid={{d.areaid}}&seatNum={{d.seatNum}}&areaname={{d.areaname}}" width="400" height="480" title="小程序码" class="layui-btn layui-btn-sm j-iframe-pop">查看二维码</a>
    <a href="{:url('delCode')}?areaid={{d.areaid}}&seatNum={{d.seatNum}}" width="400" height="480" title="小程序码" class="layui-btn layui-btn-sm layui-btn-danger">删除二维码</a>
</script>
<script type="text/javascript">
    layui.use(['table','layer','jquery'], function() {
        var table = layui.table,layer = layui.layer,$ = layui.jquery, formType = {:json_encode(form_type())};
        table.render({
            elem: '#dataTable'
            ,url: '{:url('')}' //数据接口
            ,page: true //开启分页
            ,limit: 20
            ,text: {
                none : '暂无相关数据'
            }
            ,cols: [[ //表头
                {field: 'areaname', title: '图书馆区域', width: 200}
                ,{field: 'seatNum', title: '座位编号', width: 100}
                ,{field: 'seatType', title: '座位类型', width: 120}
                ,{field: 'dTotal', title: '日选座数', width: 120}
                ,{field: 'wTotal', title: '周选座数', width: 120}
                ,{field: 'mTotal', title: '月选座数', width: 120}
                ,{field: 'yTotal', title: '年选座数', width: 120}
                ,{field: 'total', title: '总选座数', width: 120}
                ,{title: '操作', width: 250, templet: '#buttonTpl'}
            ]]
        });
    });
</script>